package com.yu.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yu.bean.Category;
import com.yu.bean.Msg;
import com.yu.service.CategoryService;
import com.yu.service.InfoService;

/**
 * 处理与分类有关的请求
 * @author YUjiangpeng
 *
 */
@Controller
public class CategoryController {
	
	@Autowired
	private CategoryService categoryService;
	
	/**
	 * 查出所有分类信息
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/category")
	public Msg getCategory(){
		List<Category> list = categoryService.getCategorys();
		return Msg.success().add("cates", list);
		
	}

}
